import type { ArticleDetailType, PublishDataType } from "@/types/publish"
import { http } from "@/utils/myRequest"

// 发布文章
export const publishApi = (data: PublishDataType, type: boolean) => {
  return http<{id: string}>({
    url: "/v1_0/mp/articles",
    method: "POST",
    data,
    params: {
      draft: type
    }
  })
}

// 获取文章详情
export const getArticleDetailApi = (id: string) => {
  return http<ArticleDetailType>({
    url: `/v1_0/mp/articles/${id}`
  })
}